/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package de.saar.penguin.give3dreplay;

import give.replay.ReplayApplication;

/**
 *
 * @author koller
 */
public class Main {
    public static void main(String[] args) throws Exception {
        boolean tryToIntegrateWithMacOS = true;
        boolean ignoreTextMessages = false;
        String overridingWindowTitle = null;

        String configFile = "matchmaker-config.xml";

        for (int i = 0; i < args.length; i++) {
            if ("--no-macos-integration".equals(args[i])) {
                tryToIntegrateWithMacOS = false;
            } else if( "--ignore-text-messages".equals(args[i])) {
                ignoreTextMessages = true;
            } else if( "--window-title".equals(args[i])) {
                overridingWindowTitle = args[++i];
            } else {
                configFile = args[i];
            }
        }

        if (tryToIntegrateWithMacOS) {
            // MacOS integration
            System.setProperty("apple.laf.useScreenMenuBar", "true");
            System.setProperty("com.apple.mrj.application.apple.menu.about.name", "GIVE 3D Replay");
        }

        ReplayWindow3D replayWindow = new ReplayWindow3D(960, 600);
        replayWindow.setEyetrackingEventSourceName("Eyetracker");
        replayWindow.setIgnoreTextMessages(ignoreTextMessages);
        replayWindow.setOverridingWindowTitle(overridingWindowTitle);
        
        ReplayApplication m = new ReplayApplication(configFile, replayWindow);
    }
}
